<?php
/*
Plugin Name: OneClick
Plugin URI: http://oneclick.wpstudio.org
Description: Installs plugins and themes
Version: 1.6
Author: Anirudh Sanjeev
Author URI: http://anirudhsanjeev.org/
Requires: WordPress Version 2.3 or above
*/

/*  Copyright 2007  Anirudh Sanjeev  (email: anirudh@anirudhsanjeev.org)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    For a copy of the GNU General Public License, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

//Load WP-Config File If This File Is Called Directly
if (!function_exists('add_action')) {
	require_once('../../../wp-config.php');
}

//Create Text Domain For Translations
add_action('init', 'oneclick_textdomain');
function oneclick_textdomain() {
	load_plugin_textdomain('oneclick', 'wp-content/plugins/oneclick');
}

// Function: Tagthis Administration Menu
// This section adds the various administrative menus that are required for managing the plugin's functions
add_action('admin_menu', 'oneclick_menu');
function oneclick_menu() {
	if (function_exists('add_menu_page')) {
		add_menu_page(__('OneClick', 'oneclick'), __('OneClick', 'oneclick'), 10, 'oneclick/frontend.php');
	}
	if (function_exists('add_submenu_page')) {
		add_submenu_page('oneclick/frontend.php', __('Install', 'oneclick'), __('Install', 'oneclick'), 'manage_oneclick', 'oneclick/frontend.php');
		add_submenu_page('oneclick/frontend.php', __('File Manager', 'oneclick'), __('File Manager', 'oneclick'), 'manage_oneclick', 'oneclick/manager.php');
		add_submenu_page('oneclick/frontend.php', __('Options', 'oneclick'), __('Options', 'oneclick'), 'manage_oneclick', 'oneclick/options.php');
		add_submenu_page('oneclick/frontend.php', __('More', 'oneclick'), __('More', 'oneclick'), 'manage_oneclick', 'oneclick/more.php');		
	}
}
add_action('admin_menu', 'initialize_oneclick');
function initialize_oneclick()
{
	$role = get_role('administrator');
	if(!$role->has_cap('manage_oneclick')) {
		$role->add_cap('manage_oneclick');
	}
}

?>